package cate.game.role.x;

import cate.game.role.RolePart;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.Optional;

public class CacheRolePartWorker<P extends RolePart> extends RolePartWorker<P> {

    @Override
    public Optional<P> findById(MongoRepository<P, String> repo, String uid) {
        return mongoCache().findById(repo, uid);
    }

    @Override
    public void save(MongoRepository<P, String> repo, P part) {
        mongoCache().save(repo, part);
    }
}
